<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>   
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>现场查勘</title>
</head>
<body>
	<div id="">
		<h1 align="center">现场查勘</h1>
	<form action="doSurvey.html" method="post" enctype="multipart/form-data">
		
		<table style="margin: 0 auto;" border="1" bordercolor="#3AB2FF" cellspacing="3" cellpadding="5">
			<tr>
				<td align="right">报案电话：</td>
				<td><input type="text" name="userphone" id="" value="${caseVO.userphone  }"/></td>
				<td align="right">出险驾驶员：</td>
				<td><input type="text" name="driver" id="" value="${caseVO.driver }" /></td>
			</tr>
			<tr>
				<td align="right">车牌号：</td>
				<td>
					<input type="text" name="carnumber " id="" value="${caseVO.carnumber  }" />
				</td>
				<td align="right">出险驾驶员电话：</td>
				<td><input type="text" name="casephone " id="" value="${caseVO.casephone  }"/></td>
			</tr>
			<tr>
				<td align="right"> 是否在现场：</td>
				<td>
					
						<c:if test="${caseVO.ishere == 0 }">
							<input type="text" name="ishere " id="" value="在现场"/>
						</c:if>
						<c:if test="${caseVO.ishere == 1 }">
							<input type="text" name="ishere " id="" value="不在现场"/>
						</c:if>
					
						
				
				</td>
				<td align="right">出险原因：</td>
				<td>
					
						<c:if test="${caseVO.accidentid == 1 }">
							<input type="text" name="accidentid " id="" value="行驶受损"/>
						</c:if>
						<c:if test="${caseVO.accidentid == 2 }">
							<input type="text" name="accidentid " id="" value="停放受损"/>
						</c:if>
						<c:if test="${caseVO.accidentid == 3 }">
							<input type="text" name="accidentid " id="" value="玻璃单独受损"/>
						</c:if>
						<c:if test="${caseVO.accidentid == 4 }">
							<input type="text" name="accidentid " id="" value="自然灾害"/>
						</c:if>
						<c:if test="${caseVO.accidentid == 5 }">
							<input type="text" name="accidentid " id="" value="其他"/>
						</c:if>
					
						
				
				</td>
			</tr>
			<tr>
				<td align="right">出险地点：</td>
				<td>
      				<input type="text" name="insuranceaddress" id="" value="${caseVO.insuranceaddress }"/>
				</td>
				<td align="right">第三方车损：</td>
				<td>
					<c:if test="${caseVO.isone  == 0 }">
						<input type="radio" name="isone" value="0" checked="checked"/>无
						<input type="radio" name="isone" value="1"/>有
					</c:if>
					<c:if test="${caseVO.isone  == 1 }">
						<input type="radio" name="isone" value="0" />无
						<input type="radio" name="isone" value="1" checked="checked"/>有
					</c:if>
				
				</td>
			</tr>
            <tr>
				<td align="right">人员伤亡：</td>
				<td>
					<c:if test="${caseVO.casualtystatus  == 0 }">
						<input type="radio" name="casualtystatus" value="1" />有
						<input type="radio" name="casualtystatus" value="0" checked="checked"/>没有
					</c:if>
					<c:if test="${caseVO.casualtystatus  == 1 }">
						<input type="radio" name="casualtystatus" value="1" checked="checked"/>有
						<input type="radio" name="casualtystatus" value="0" />没有
					</c:if>
				
				</td>
			</tr>
			
			
			<tr>
				<td align="right">查勘意见：</td>
				<td colspan="3">
				<select id=""name="assessmentstatusonline" style="width: 56%;">
						
							<option value="2" selected="selected">请选择</option>
							<option value="0">可以在线定损</option>
							<option value="1">不能在线定损</option>
					
				</select>
	
				</td>
			</tr>
			<!--多图上传-->
			<tr>
			    <td align="right">审核照片：</td>
				<td colspan="3" style="position: relative;">
				<c:if test="${caseVO.imgList!=null}">
				     <c:forEach var="ownCheckImg" items="${caseVO.imgList}" varStatus="status">
				         <c:if test="${status.index%3==0}"><br/></c:if>
				     <img src="${ownCheckImg.imdaddress}" id="img" style="position: relative;"><input type="checkbox" name="ids" value="${ownCheckImg.imgcheckid}">
				 
				     </c:forEach>
			    </c:if>
		
			
			</td>
			</tr>
			
			<tr>
				<td align="right">审查员：</td>
				<td colspan="3">
				<input type="text" name="employeename" value="${caseVO.employee.employeename}"/>
			              
		        </td>
			</tr>
			<tr><td align="center" colspan="4">
				
				<input type="hidden" name="caseno" value="${caseVO.caseno}">
				<input type="hidden" name="employeeid" value="${caseVO.employee.employeeid}">
				<input type="submit" value="保 存"/>&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="reset" value="重 置" onclick="resets()"/>
			</td></tr>
		</table>
	</form>
 </div>
 
 
 	<style type="text/css">
 		input[type="submit"]{
 			width: 10%;
 			height: 35px;
 			font-size: 18px;
 		}
 		input[type="reset"]{
 			width: 10%;
 			height: 35px;
 			font-size: 18px;
 		}
 		input[type="file"]{
 			width: 15%;
 			height: 140px;
 			opacity: 0;
 		}
 		
 		img {
 			width: 15%;
 			height: 140px;
 			position: absolute;
 			left: 0.4%;
 			bottom: 3px;
 			border: 1px solid;
 			z-index: -1;
 		}
 
 	</style>
 	
 	
 	<script type="text/javascript" src="js/jquery-1.12.4.js" ></script>
 	<script>
 		function resets() {
 			$("#img1").attr("src","images/tupian1.jpg");
 			$("#img2").attr("src","images/tupian1.jpg");
 			$("#img3").attr("src","images/tupian1.jpg");
 		}
 		//前端获取“选中图片”的路径
 		function mm (code) {
 			var a = document.getElementById("one");
 			var b = document.getElementById("two");
 			var c = document.getElementById("three");
 			if(code == 1){
 				ii(a,code);
 			}else if (code == 2) {
 				ii(b,code);
 			}else{
 				ii(c,code);
 			}
 		}

		function ii(obj,codes){
			//解决文件路径C:\fakepath问题
    		var oFReader = new FileReader();
    		var file =obj.files[0];
    		oFReader.readAsDataURL(file);
    		
    		oFReader.onloadend = function(oFRevent){
	        	var src = oFRevent.target.result;
//	        	alert(src);
	        	if(codes == 1){
	        		$('#img1').attr('src',src);
	        	}
	        	if (codes == 2) {
	        		$('#img2').attr('src',src);
	        	}
	        	if (codes == 3) {
	        		$('#img3').attr('src',src);
	        	}
    		}
    	}
 	</script>
 	
 	
</body>
</html>